package pr.iceworld.fernando.gatecommon.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import pr.iceworld.fernando.gatecommon.service.BaseService;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * Created by ferna on 2018/6/12.
 */
public class BizService<M extends Mapper<T>, T> implements BaseService<T> {

    @Autowired
    protected M mapper;

    @Override
    public T selectOne(T t) {
        return mapper.selectOne(t);
    }

    @Override
    public T selectByPrimaryKey(Object id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<T> select(T t) {
        return mapper.select(t);
    }

    @Override
    public List<T> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public Long selectCount(T t) {
        return Long.valueOf(mapper.selectCount(t));
    }

    @Override
    public void insert(T t) {
        mapper.insert(t);
    }

    @Override
    public void insertSelective(T t) {
        mapper.insertSelective(t);
    }

    @Override
    public void delete(T t) {
        mapper.delete(t);
    }

    @Override
    public void deleteByPrimaryKey(Object id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateByPrimaryKey(T t) {
        mapper.updateByPrimaryKey(t);
    }

    @Override
    public void updateByPrimaryKeySelective(T t) {
        mapper.updateByPrimaryKeySelective(t);
    }

    @Override
    public List<T> selectByExample(Object object) {
        return mapper.selectByExample(object);
    }

    @Override
    public int selectCountByExample(Object obj) {
        return mapper.selectCountByExample(obj);
    }

}
